home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / QuickTime / Sound / SampleSndPlay / SampleSndPlay.cp < prev    next >
Encoding:
Text File  |  2000-09-28  |  693 b   |  36 lines  |  [TEXT/MPS ]

  1. #include    <Quickdraw.h>
  2. #include    <Windows.h>
  3. #include    <dialogs.h>
  4. #include    <OSEvents.h>
  5. #include    <Packages.h>
  6. #include    <Sound.h>
  7.  
  8. #define    TRUE            0xFF
  9. #define    FALSE            0
  10.  
  11. main()
  12. {
  13.     Point                where = {20,20};
  14.     OSErr                err;
  15.     SFReply                reply;
  16.     short                refnum;
  17.     char*                string;
  18.     
  19.     InitGraf(&qd.thePort);
  20.     FlushEvents(everyEvent, 0);
  21.     InitWindows();
  22.     InitDialogs(nil);
  23.     InitCursor();
  24.     
  25.     string = (char*) "\pPick a SND File";
  26.  
  27.     SFGetFile (where, (Str255) string, nil, -1, (SFTypeList) nil, nil, &reply);
  28.     err = FSOpen(reply.fName, reply.vRefNum, &refnum);
  29.     if (err != noErr)
  30.         Debugger();
  31.     
  32.     err = SndStartFilePlay (nil, refnum, 0, 74000, nil, nil, nil, FALSE);
  33.     if (err != noErr)
  34.         Debugger();
  35.         
  36. }